Optimal. Leaf size=34 \[ -\frac{a^2 \cot (e+f x)}{f}-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}+b^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0655697, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {2789, 3770, 3012, 8} \[ -\frac{a^2 \cot (e+f x)}{f}-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}+b^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2789
Rule 3770
Rule 3012
Rule 8
Rubi steps
\begin{align*} \int \csc ^2(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc (e+f x) \, dx+\int \csc ^2(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac{a^2 \cot (e+f x)}{f}+b^2 \int 1 \, dx\\ &=b^2 x-\frac{2 a b \tanh ^{-1}(\cos (e+f x))}{f}-\frac{a^2 \cot (e+f x)}{f}\\ \end{align*}
Mathematica [B] time = 0.220298, size = 76, normalized size = 2.24 \[ \frac{a^2 \tan \left (\frac{1}{2} (e+f x)\right )+a^2 \left (-\cot \left (\frac{1}{2} (e+f x)\right )\right )+2 b \left (2 a \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-2 a \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )+b e+b f x\right )}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.042, size = 52, normalized size = 1.5 \begin{align*}{b}^{2}x-{\frac{{a}^{2}\cot \left ( fx+e \right ) }{f}}+2\,{\frac{ab\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}}+{\frac{{b}^{2}e}{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.65617, size = 70, normalized size = 2.06 \begin{align*} \frac{{\left (f x + e\right )} b^{2} - a b{\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac{a^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.99554, size = 209, normalized size = 6.15 \begin{align*} \frac{b^{2} f x \sin \left (f x + e\right ) - a b \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) \sin \left (f x + e\right ) + a b \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) \sin \left (f x + e\right ) - a^{2} \cos \left (f x + e\right )}{f \sin \left (f x + e\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (e + f x \right )}\right )^{2} \csc ^{2}{\left (e + f x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.75793, size = 107, normalized size = 3.15 \begin{align*} \frac{2 \,{\left (f x + e\right )} b^{2} + 4 \, a b \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) \right |}\right ) + a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - \frac{4 \, a b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + a^{2}}{\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]